package com.ruoyi.camp.service.impl;

import java.util.List;

import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.camp.mapper.CCampUserMapper;
import com.ruoyi.camp.domain.CCampUser;
import com.ruoyi.camp.service.ICCampUserService;

/**
 * userService业务层处理
 * 
 * @author ruoyi
 * @date 2024-10-25
 */
@Service
public class CCampUserServiceImpl implements ICCampUserService 
{
    @Autowired
    private CCampUserMapper cCampUserMapper;

    /**
     * 查询user
     * 
     * @param userId user主键
     * @return user
     */
    @Override
    public CCampUser selectCCampUserByUserId(String userId)
    {
        return cCampUserMapper.selectCCampUserByUserId(userId);
    }

    /**
     * 根据openid查询用户
     * @param openId
     * @return
     */
    @Override
    public CCampUser selectCampUserByOpenId(String openId) {
        return cCampUserMapper.selectCampUserByOpenId(openId);
    }

    /**
     * 查询user列表
     * 
     * @param cCampUser user
     * @return user
     */
    @Override
    public List<CCampUser> selectCCampUserList(CCampUser cCampUser)
    {
        return cCampUserMapper.selectCCampUserList(cCampUser);
    }

    /**
     * 新增user
     * 
     * @param cCampUser user
     * @return 结果
     */
    @Override
    public int insertCCampUser(CCampUser cCampUser)
    {
        cCampUser.setUserId(IdUtils.randomUUID());
        return cCampUserMapper.insertCCampUser(cCampUser);
    }

    /**
     * 修改user
     * 
     * @param cCampUser user
     * @return 结果
     */
    @Override
    public int updateCCampUser(CCampUser cCampUser)
    {
        return cCampUserMapper.updateCCampUser(cCampUser);
    }

    /**
     * 批量删除user
     * 
     * @param userIds 需要删除的user主键
     * @return 结果
     */
    @Override
    public int deleteCCampUserByUserIds(String[] userIds)
    {
        return cCampUserMapper.deleteCCampUserByUserIds(userIds);
    }

    /**
     * 删除user信息
     * 
     * @param userId user主键
     * @return 结果
     */
    @Override
    public int deleteCCampUserByUserId(String userId)
    {
        return cCampUserMapper.deleteCCampUserByUserId(userId);
    }
}
